package pl.com.qapps.unity;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author Jakub Dykowski
 * 
 */
class Test {

	/**
	 * @param args
	 * @throws IOException
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws IOException, InterruptedException {
		Process process = new ProcessBuilder()
				.command(
						"python",
						"-u",
						"/home/qba/Dokumenty/eclipse/UnityJavaAPI/src/qapps/unity/ressources/unitylauncher.py kadu.desktop")
				.directory(null).start();

		// ResponsePb res =
		// ResponsePb.newBuilder().setResult(Status.SUCCESS).build();
		//
		// System.out.println(res.getSerializedSize());
		// res.writeTo(System.out);
		// System.out.println();
		OutputStream out = process.getOutputStream();
		for (int i = 0; i < 10; i++)
			out.write(255);

		InputStream in = process.getInputStream();
		int b;
		while ((b = in.read()) > -1) {
			System.out.print(b + " ");
		}
		System.out.println("EOF");
		System.out.println(process.waitFor());

	}

}
